#!/usr/bin/env python3
# -*- coding: utf-8 -*-

s1 = 72
s2 = 85 
r = (85 - 72) * 100 / 72
print('1. r = %.1f%%' % r)
print ('2. r = {0:.1f}%'.format(r))
print(f'3. r = {r:.1f}%')

print(ord('0'))
print(chr(0x31)) # '1'
print(chr(66)) # ‘B’
print(chr(0x6587)) # 文
print('\u4e2d\u6587') # 中文

print('ABC'.encode('ascii'))
print('中文'.encode('utf-8'))
# print('中文'.encode('ascii')) # 错误
print(b'ABC'.decode('ascii'))
print(b'\xe4\xb8\xad\xe6\x96\x87'.decode('utf-8'))
print(len('ABC'))
print(len('中文'))
print(len('ABC'.encode('ascii')))
print(len('中文'.encode('utf-8')))